package com.woniuxy.yygh.hsop.controller;

import com.woniuxy.yygh.common.result.Result;
import com.woniuxy.yygh.hsop.service.DepartmentService;
import com.woniuxy.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <P> @Author: ideaAdmin
 * <P> TODO: Class
 * <P> TODO: 科室信息
 * <P> Date: 2022/3/2:19:20
 * <P> Description:
 */
@RestController
@RequestMapping("/admin/hosp/department")
//@CrossOrigin
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;

    /**
        * TODO:根据医院编号 查询所有的科室列表
    **/
    @ApiOperation(value = "根据医院编号 查询所有的科室列表")
    @GetMapping("/getDeptList/{hoscode}")
    public Result getDeptList(@PathVariable String hoscode){
        List<DepartmentVo> list  = departmentService.findDeptTree(hoscode);
        return  Result.ok(list);
    }


}
